L=1000000000; S=9; T=10; M=100; stones=[20,19,18,204791526,309450881,204791529,204791531,204791530,41120047,54831469,204791521,35303689,204791541,640793026,204791537,204791532,102509713,204791524,19645065,204791523,86850867,86850873,86850876,86850861,883927837,694174339,86850878,86850863,16557859,496954773,86850870,431983193,86850865,86850872,276232113,86850866,653084785,86850868,86850864,90857836,385904965,385904973,385904978,385904976,385904975,385904968,385904970,385904981,385904972,231291447,385904977,385904963,385904966,86611735,1995761,105938001,151165801,385904982,385904969,190185061,467659707,467659717,467659714,467659710,467659724,467659704,467659708,467659705,121341339,467659713,102905221,467659718,467659719,467659723,47825601,80223165,467659716,270257251,24823840,87415923,591284817,591284818,591284815,142689408,591284822,13526935,74608929,591284826,591284816,591284814,340124751,229753940,591284811,591284825,591284823,98320912,167684963,591284808,42589821,387370666];